<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, adminUser-scalable=0">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
    <script>
        var base =  "${base}";
    </script>
</head>
<body>
<br>
<form class="layui-form " action="">
          <div class="layui-form-item">
              <label class="layui-form-label">名字</label>
              <div class="layui-input-block">
                  <input type="text" id="personalName" name="personalName"   autocomplete="off" placeholder="请输入名字"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">求职状态 类型ID</label>
              <div class="layui-input-block">
                  <input type="text" id="labelId" name="labelId"   autocomplete="off" placeholder="请输入求职状态 类型ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">0男/1女</label>
              <div class="layui-input-block">
                  <input type="text" id="personalGender" name="personalGender"   autocomplete="off" placeholder="请输入0男/1女"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">开始工作时间</label>
              <div class="layui-input-block">
                  <input type="text" id="personalStartTime" name="personalStartTime"   autocomplete="off" placeholder="请输入开始工作时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">生日</label>
              <div class="layui-input-block">
                  <input type="text" id="personalBirthday" name="personalBirthday"   autocomplete="off" placeholder="请输入生日"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">微信号</label>
              <div class="layui-input-block">
                  <input type="text" id="personalWecharNumber" name="personalWecharNumber"   autocomplete="off" placeholder="请输入微信号"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">电话</label>
              <div class="layui-input-block">
                  <input type="text" id="personalPhone" name="personalPhone"   autocomplete="off" placeholder="请输入电话"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">邮箱</label>
              <div class="layui-input-block">
                  <input type="text" id="personalEmail" name="personalEmail"   autocomplete="off" placeholder="请输入邮箱"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">职位名称ID</label>
              <div class="layui-input-block">
                  <input type="text" id="personalPositionId" name="personalPositionId"   autocomplete="off" placeholder="请输入职位名称ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">修改时间</label>
              <div class="layui-input-block">
                  <input type="text" id="personalUpdateTime" name="personalUpdateTime"   autocomplete="off" placeholder="请输入修改时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">创建时间</label>
              <div class="layui-input-block">
                  <input type="text" id="personalCreateTime" name="personalCreateTime"   autocomplete="off" placeholder="请输入创建时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">用户头像</label>
              <div class="layui-input-block">
                  <input type="text" id="personalPhoto" name="personalPhoto"   autocomplete="off" placeholder="请输入用户头像"
                         class="layui-input">
              </div>
          </div>

    <div align="center">
        <button type="button" class="layui-btn" id="submit">保存</button>
    </div>
</form>

<script src="${base}/static/win10/component/layui/layui.js?t=1"></script>
<script src="${base}/static/win10/js/jquery-1.8.3.min.js?t=1"></script>
<script>
    layui.use(['form', 'layer'], function() {
        var form = layui.form
                , layer = layui.layer;
        $("#submit").on("click",function () {
            if(check()===false){
                return;
            }

            var formDate = {
                         personalName:$("#personalName").val(),
                         labelId:$("#labelId").val(),
                         personalGender:$("#personalGender").val(),
                         personalStartTime:$("#personalStartTime").val(),
                         personalBirthday:$("#personalBirthday").val(),
                         personalWecharNumber:$("#personalWecharNumber").val(),
                         personalPhone:$("#personalPhone").val(),
                         personalEmail:$("#personalEmail").val(),
                         personalPositionId:$("#personalPositionId").val(),
                             personalPhoto:$("#personalPhoto").val()
            }
            $.ajax({
                type: "POST",
                url: base+"/WeChatUser/wechatPersonal/admin/addWechatPersonal",
                data: formDate,
                success: function (data) {
                    layer.msg(data.message)
                    if (data.code === 200) {
                        window.location.href=base+"/WeChatUser/wechatPersonal/admin/main.html"
                    } else {

                    }
                }
            });
        })







        function check(){
                   if($("#personalName").val().length<1){
                       layer.msg("请输入名字");
                       return false;
                   }
                   if($("#labelId").val().length<1){
                       layer.msg("请输入求职状态 类型ID");
                       return false;
                   }
                   if($("#personalGender").val().length<1){
                       layer.msg("请输入0男/1女");
                       return false;
                   }
                   if($("#personalStartTime").val().length<1){
                       layer.msg("请输入开始工作时间");
                       return false;
                   }
                   if($("#personalBirthday").val().length<1){
                       layer.msg("请输入生日");
                       return false;
                   }
                   if($("#personalWecharNumber").val().length<1){
                       layer.msg("请输入微信号");
                       return false;
                   }
                   if($("#personalPhone").val().length<1){
                       layer.msg("请输入电话");
                       return false;
                   }
                   if($("#personalEmail").val().length<1){
                       layer.msg("请输入邮箱");
                       return false;
                   }
                   if($("#personalPositionId").val().length<1){
                       layer.msg("请输入职位名称ID");
                       return false;
                   }
                   if($("#personalUpdateTime").val().length<1){
                       layer.msg("请输入修改时间");
                       return false;
                   }
                   if($("#personalCreateTime").val().length<1){
                       layer.msg("请输入创建时间");
                       return false;
                   }
                   if($("#personalPhoto").val().length<1){
                       layer.msg("请输入用户头像");
                       return false;
                   }
        }
    });

</script>
</body>
</html>